package com.mju.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MPConfig {
    // 配置拦截器
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        // 初始化mp拦截器栈
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        // 初始化分页拦截器，并加入到mp拦截器栈中
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return  interceptor;
    }

//    //逻辑删除
//    @Bean
//    public ISqlInjector iSqlInjector(){
//        return new LogicSqlInjector();
//    }
}
